var status = -1;
var level = "40";
var header = "#fn黑体##fs32#B - " + level + " F\r\n\r\n";

function action(e, d, c) {
    status++;
    var b = cm.getEventManager("副本_起源之塔");
    var f = b == null ? null : b.getProperty("stage" + level);
    if (f != null && f.equals("start")) {
        cm.dispose();
        return
    }
    if (cm.getInfoQuest(42001).contains("noHelp=1")) {
        startMap(b);
        return
    }
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.curNodeEventEnd(true);
            cm.setInGameDirectionMode(true, false);
            cm.setStandAloneMode(true);
            cm.inGameDirectionEvent_AskAnswerTime(30)
        } else {
            if (status === a++) {
                cm.fieldEffect_InsertCanvas(1, 128, 0, 0, 0, 1000, 0);
                cm.inGameDirectionEvent_AskAnswerTime(1000)
            } else {
                if (status === a++) {
                    cm.inGameDirectionEvent_Monologue(header + "#fs22#第40层正由获得了头脑的稻草人守护着。它们可不好对付。\r\n\r\n由于稻草人是由稻草构成的，通过普通的攻击很难对其造成伤害。同时它们也存在弱点。\r\n\r\n你看见那边着火的地方了吗？你将稻草人引到那里。那样，稻草人就会被渐渐焚烧的。\r\n\r\n虽然你引来的稻草人越多，它们被烧毁的速度也就越快，不过那样它们就会更加愤怒，进而向你发动致命攻击的。\r\n\r\n你要小心这一点！", 30000)
                } else {
                    if (status === a++) {
                        cm.fieldEffect_InsertCanvas(0, 0, 0, 0, 1000, 0, 0);
                        cm.curNodeEventEnd(true);
                        cm.setInGameDirectionMode(false, true);
                        cm.setStandAloneMode(false);
                        startMap(b)
                    } else {
                        cm.dispose()
                    }
                }
            }
        }
    }
}

function startMap(a) {
    cm.dispose();
    cm.updateHeaderUI(1, 2, cm.getEventInstance().getTimeLeft(), 0, cm.getEventInstance().getTimeLeft(), 42011);
    a.setProperty("stage" + level, "start");
    cm.getMap().getWeatherEffectNotice("请消灭稻草人，前往下一层吧。", 147, 60000, 1);
    cm.fieldEffect_ScreenMsg("UI/UIWindowPL.img/HiddenCatch/StageImg/start");
    var c = a.getMapFactoryMap(cm.getMapId());
    var b = a.getMonster(9309203);
    c.spawnMonsterOnGroundBelow(b, new java.awt.Point(1000, 0))
}

function start() {
    status = -1;
    action(1, 0, 0)
};